﻿@model SCMS.UI.Models.AdvanceRequestModel
@{AjaxOptions ajaxOpts = new AjaxOptions
{
    UpdateTargetId = "R4ADiv",
    LoadingElementId = "loading",
    HttpMethod = "Post",
    Url = Url.Action("SaveR4A")
};}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="partialViewCard">
    <div class="partialViewCardHeader"><h3>New Request For Advance</h3></div>
    @using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form" }))
    {
        @Html.ValidationSummary(true)
        <br />
        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="2">
            <tr class="gridheader">
                <td width="33%">
                    RFA Ref No.
                </td>
                <td width="33%">
                    Date
                </td>
                <td width="34%">
                    Currency
                </td>
            </tr>
            <tr>
                <td>
                    @Html.TextBoxFor(m => m.RefNumber, new { @readonly = "readonly" })
                    @Html.HiddenFor(m => m.Id)
                    @Html.HiddenFor(m => m.TotalAdvance)
                </td>
                <td>
                    @Html.EditorFor(m => m.RequestDate)
                </td>
                <td>
                    @Html.DropDownListFor(x => x.CurrencyId, Model.Currencies, "--Please Select--")
                    @Html.ValidationMessageFor(x => x.CurrencyId)
                </td>
            </tr>
            <tr class="gridheader">
                <td>
                    Payment Terms
                </td>
                <td>
                    Payment Type
                </td>
                <td>
                    Payment To
                </td>
            </tr>
            <tr>
                <td>
                    @Html.DropDownListFor(x => x.PaymentTermId, Model.PaymentTerms, "--Please Select--")
                    @Html.ValidationMessageFor(x => x.PaymentTermId)
                </td>
                <td>
                    @Html.DropDownListFor(x => x.PaymentTypeId, Model.PaymentTypes, "--Please Select--")
                    @Html.ValidationMessageFor(x => x.PaymentTypeId)
                </td>
                <td>
                    @Html.DropDownListFor(x => x.PaidTo, Model.StaffList, "--Please Select--")
                    @Html.ValidationMessageFor(x => x.PaidTo)
                </td>
            </tr>
            <tr class="gridheader">
                <td colspan="3">
                    Subject/Purpose
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    @Html.TextBoxFor(x => x.Subject)
                    @Html.ValidationMessageFor(x => x.Subject, "Subject is required")
                </td>
            </tr>
            <tr>
                <td colspan="3" align="right">
                    <input type="submit" value="Proceed" class="btn green" />
                </td>
            </tr>
        </table>
        <br />
    }
</div>

